/*
    E2020159
    唐琴凤
    2023-9-21
    实践2-class版本
*/
#include <iostream>
using namespace std;
#include <vector>
#include <string.h>
#include<fstream>

#include <stdlib.h>
#include <string.h>

// 判断键盘按下需要的头文件
#include <termio.h>


#include "student.h"
#include "student.cpp"
#include "smart_car.h"
#include "smart_car.cpp"
#include "tire.h"
#include "tire.cpp"
#include "chassis.h"
#include "chassis.cpp"
#include "agx.h"
#include "agx.cpp"
#include "binocular_camera.h"
#include "binocular_camera.cpp"
#include "gyroscope_9axis.h"
#include "gyroscope_9axis.cpp"
#include "multi_line_lidar.h"
#include "multi_line_lidar.cpp"
#include "lcd_isplay_screen.h"
#include "lcd_isplay_screen.cpp"
#include "battery_module.h"
#include "battery_module.cpp"




// 主函数
int main(){
    Smart_car smart_car;
    Chassis chassis;
    Agx agx;
    Binocular_camera binocular_camera;
    Multi_line_lidar multi_line_lidar;
    Gyroscope_9axis gyroscope_9axis;
    Lcd_isplay_screen lcd_isplay_screen;
    Battery_module battery_module;

    smart_car.setAgx(agx);
    smart_car.setBinocular_camera(binocular_camera);
    smart_car.setChassis(chassis);
    smart_car.setGyroscope_9axis(gyroscope_9axis);
    smart_car.setLcd_isplay_screen(lcd_isplay_screen);
    smart_car.setMulti_line_lidar(multi_line_lidar);
    smart_car.seBattery_module(battery_module);

    multi_line_lidar.add(&chassis);


    /////////////////障碍物状态可通过命令行方式输入。比如1代表前方障碍，2代表左前方障碍，3代表右前方障碍
    int x;
    cout<<"请输入障碍物状态，1代表前方障碍，2代表左前方障碍，3代表右前方障碍"<<endl;
    while (true)
    {
        cout<<endl;
        cin>>x;
        if(x==1){
            cout<<"障碍物状态为“前方“"<<endl;
        }else if(x==2){
            cout<<"障碍物状态为“右前方“"<<endl;
        }else if(x==3){
                cout<<"障碍物状态为“左前方“"<<endl;
        }else {
            cout<<"输入得数字不符合要求"<<endl;
        }

        multi_line_lidar.notify(x);
    }
    


    return 0;
}
